
#include    "../../armlinux/config.h"
typedef struct _REG_INFO
{
    uint32 l2Mem[512*1024/4];
    uint32 interMem[64*1024/4];
    uint32 gpu[64*1024/4];
    uint32 cif0[8*1024/4];
    uint32 cif1[8*1024/4];
    uint32 lcd0[8*1024/4];
    uint32 lcd1[8*1024/4];
    uint32 ipp[16*1024/4];
    uint32 rga[8*1024/4];
    uint32 htmiTx[8*1024/4];
    uint32 i2s0[8*1024/4];
    uint32 i2s1[8*1024/4];
    uint32 i2s2[8*1024/4];
    uint32 spdif[8*1024/4];
    uint32 uart0[8*1024/4];
    uint32 uart1[8*1024/4];
    uint32 cpuAxiBuf[32*1024/4];
    uint32 l2c[1*1024/4];//16*1024/4
    uint32 scu[256/4];
    uint32 gic[256/4];
    uint32 coreTimer[1*1024/4];
    uint32 coreWdt[2*1024/4+512/4];
    uint32 coreIntrDis[4*1024/4];
    uint32 usbOtg[256*1024/4];
    uint32 usbHost[256*1024/4];
    uint32 mac[16*1024/4];
    uint32 gps[16*1024/4];
    uint32 hsadc[16*1024/4];
    uint32 sdmmc0[16*1024/4];
    uint32 sdio[16*1024/4];
    uint32 eMmc[16*1024/4];
    uint32 pidFilter[16*1024/4];
    uint32 ahbArbiter0[16*1024/4];
    uint32 ahbArbiter1[16*1024/4];
    uint32 periAxiBus[1024*1024/4];
    uint32 nandc[16*1024/4];
    uint32 smcBank0[1024*1024/4];
    uint32 smcBank1[1024*1024/4];

    uint32 cpuDebug[128*1024/4];
    uint32 apbCru[16*1024/4];
    uint32 apbPmu[16*1024/4];
    uint32 apbGrf[8*1024/4];
    uint32 apbGpio6[8*1024/4];
    uint32 apbTimer3[8*1024/4];
    uint32 eFuse[16*1024/4];
    uint32 tzpc[16*1024/4];
    uint32 dmac1[16*1024/4];
    uint32 dmac1Reg[16*1024/4];
    uint32 ddrPctl[16*1024/4];
    uint32 i2c0[8*1024/4];
    uint32 i2c1[8*1024/4];
    uint32 pwm0[16*1024/4];
    uint32 gpio0[16*1024/4];
    uint32 timer0[8*1024/4];
    uint32 timer1[8*1024/4];
    uint32 gpio1[8*1024/4];
    uint32 gpio2[8*1024/4];
    uint32 ddrPubl[16*1024/4];
    uint32 wdt[16*1024/4];
    uint32 pwm2[16*1024/4];
    uint32 pwm3[16*1024/4];
    uint32 i2c2[16*1024/4];
    uint32 i2c3[16*1024/4];
    uint32 i2c4[16*1024/4];
    uint32 tsAdc[16*1024/4];
    uint32 uart2[16*1024/4];
    uint32 uart3[16*1024/4];
    uint32 sarAdc[16*1024/4];
    uint32 spi0[16*1024/4];
    uint32 spi1[16*1024/4];
    uint32 dmac2Reg[16*1024/4];
    uint32 smcReg[16*1024/4];
    uint32 gpio3[16*1024/4];
    uint32 gpio4[16*1024/4];
    uint32 gpio5[16*1024/4];
}REG_INFO, *pREG_INFO;

typedef struct _REG_RAW_INFO
{
    uint32 l2Mem[512*1024/4];
    uint32 interMem[64*1024/4];
    uint32 gpu[64*1024/4];
    uint32 Reserved0[384*1024/4];
    uint32 rom[16*1024/4];
    uint32 vCodec[16*1024/4];
    uint32 cif0[8*1024/4];
    uint32 cif1[8*1024/4];
    uint32 lcd0[8*1024/4];
    uint32 lcd1[8*1024/4];
    uint32 ipp[16*1024/4];
    uint32 rga[8*1024/4];
    uint32 htmiTx[8*1024/4];
    uint32 i2s0[8*1024/4];
    uint32 i2s1[8*1024/4];
    uint32 i2s2[8*1024/4];
    uint32 spdif[8*1024/4];
    uint32 Reserved1[16*1024/4];
    uint32 uart0[8*1024/4];
    uint32 uart1[8*1024/4];
    uint32 cpuAxiBuf[32*1024/4];
    uint32 Reserved2[32*1024/4];
    uint32 l2c[16*1024/4];
    uint32 scu[256/4];
    uint32 gic[256/4];
    uint32 coreTimer[1*1024/4];
    uint32 coreWdt[2*1024/4+512/4];
    uint32 coreIntrDis[4*1024/4];
    uint32 Reserved3[(0x10180000-0x1013e000)/4];
    uint32 usbOtg[256*1024/4];
    uint32 usbHost[256*1024/4];
    uint32 Reserved4[16*1024/4];
    uint32 mac[16*1024/4];
    uint32 Reserved5[16*1024/4];
    uint32 gps[16*1024/4];
    uint32 hsadc[16*1024/4];
    uint32 sdmmc0[16*1024/4];
    uint32 sdio[16*1024/4];
    uint32 eMmc[16*1024/4];
    uint32 pidFilter[16*1024/4];
    uint32 ahbArbiter0[16*1024/4];
    uint32 ahbArbiter1[16*1024/4];
    uint32 Reserved6[848*1024/4];
    uint32 periAxiBus[1024*1024/4];
    uint32 Reserved7[1024*1024/4];
    uint32 nandc[16*1024/4];
    uint32 Reserved8[11248*1024/4];
    uint32 smcBank0[1024*1024/4];
    uint32 Reserved9[15*1024*1024/4];
    uint32 smcBank1[1024*1024/4];
    uint32 Reserved10[15*1024*1024/4];
    uint32 Reserved11[(0x1FFE0000-0x13000000)/4];
    uint32 cpuDebug[128*1024/4];
    uint32 apbCru[16*1024/4];
    uint32 apbPmu[16*1024/4];
    uint32 apbGrf[8*1024/4];
    uint32 apbGpio6[8*1024/4];
    uint32 Reserved12[8*1024/4];
    uint32 apbTimer3[8*1024/4];
    uint32 eFuse[16*1024/4];
    uint32 tzpc[16*1024/4];
    uint32 dmac1[16*1024/4];
    uint32 dmac1Reg[16*1024/4];
    uint32 ddrPctl[16*1024/4];
    uint32 Reserved13[32*1024/4];
    uint32 i2c0[8*1024/4];
    uint32 i2c1[8*1024/4];
    uint32 pwm0[16*1024/4];
    uint32 gpio0[16*1024/4];
    uint32 timer0[8*1024/4];
    uint32 timer1[8*1024/4];
    uint32 gpio1[8*1024/4];
    uint32 gpio2[8*1024/4];
    uint32 ddrPubl[16*1024/4];
    uint32 Reserved14[32*1024/4];
    uint32 wdt[16*1024/4];
    uint32 pwm2[16*1024/4];
    uint32 pwm3[16*1024/4];
    uint32 i2c2[16*1024/4];
    uint32 i2c3[16*1024/4];
    uint32 i2c4[16*1024/4];
    uint32 tsAdc[16*1024/4];
    uint32 uart2[16*1024/4];
    uint32 uart3[16*1024/4];
    uint32 sarAdc[16*1024/4];
    uint32 spi0[16*1024/4];
    uint32 spi1[16*1024/4];
    uint32 dmac2Reg[16*1024/4];
    uint32 smcReg[16*1024/4];
    uint32 gpio3[16*1024/4];
    uint32 gpio4[16*1024/4];
    uint32 gpio5[16*1024/4];
}REG_RAW_INFO, *pREG_RAW_INFO;


__align(4096) REG_INFO gDumpReg;

void reg_memcpy(void *des,void *src,uint32 length)
{
    uint32 i;
    uint32 *pdes = ( uint32 *)des;
    uint32 *psrc = ( uint32 *)src;
    printf("reg_memcpy des = 0x%x,src = 0x%x\n",(uint32)des-(uint32)(&gDumpReg),src);
    for(i=0;i<length/4;i++)
    {
        *pdes++ = *psrc++;
    }
}


void dumpreg(void)
{
    pREG_RAW_INFO  pRawReg = (pREG_RAW_INFO)0x10000000;
    printf("gDumpReg = 0x%x,size = 0x%x\n",&gDumpReg, sizeof(gDumpReg));
    reg_memcpy (&gDumpReg.l2Mem, pRawReg->l2Mem, sizeof(gDumpReg.l2Mem));
    reg_memcpy (&gDumpReg.interMem, pRawReg->interMem, sizeof(gDumpReg.interMem));
    //reg_memcpy (&gDumpReg.gpu, pRawReg->gpu, sizeof(gDumpReg.gpu));
    reg_memcpy (&gDumpReg.cif0, pRawReg->cif0, sizeof(gDumpReg.cif0));
    reg_memcpy (&gDumpReg.cif1, pRawReg->cif1, sizeof(gDumpReg.cif1));
    reg_memcpy (&gDumpReg.lcd0, pRawReg->lcd0, sizeof(gDumpReg.lcd0));
    reg_memcpy (&gDumpReg.lcd1, pRawReg->lcd1, sizeof(gDumpReg.lcd1));
    reg_memcpy (&gDumpReg.ipp, pRawReg->ipp, sizeof(gDumpReg.ipp));
    reg_memcpy (&gDumpReg.rga, pRawReg->rga, sizeof(gDumpReg.rga));
    reg_memcpy (&gDumpReg.htmiTx, pRawReg->htmiTx, sizeof(gDumpReg.htmiTx));
    reg_memcpy (&gDumpReg.i2s0, pRawReg->i2s0, sizeof(gDumpReg.i2s0));
    reg_memcpy (&gDumpReg.i2s1, pRawReg->i2s1, sizeof(gDumpReg.i2s1));
    reg_memcpy (&gDumpReg.i2s2, pRawReg->i2s2, sizeof(gDumpReg.i2s2));
    reg_memcpy (&gDumpReg.spdif, pRawReg->spdif, sizeof(gDumpReg.spdif));
    reg_memcpy (&gDumpReg.uart0, pRawReg->uart0, sizeof(gDumpReg.uart0));
    reg_memcpy (&gDumpReg.uart1, pRawReg->uart1, sizeof(gDumpReg.uart1));
    //reg_memcpy (&gDumpReg.cpuAxiBuf, pRawReg->cpuAxiBuf, sizeof(gDumpReg.cpuAxiBuf));
    reg_memcpy (&gDumpReg.l2c, pRawReg->l2c, sizeof(gDumpReg.l2c));
    reg_memcpy (&gDumpReg.scu, pRawReg->scu, sizeof(gDumpReg.scu));
    reg_memcpy (&gDumpReg.gic, pRawReg->gic, sizeof(gDumpReg.gic));
    reg_memcpy (&gDumpReg.coreTimer, pRawReg->coreTimer, sizeof(gDumpReg.coreTimer));
    reg_memcpy (&gDumpReg.coreWdt, pRawReg->coreWdt, sizeof(gDumpReg.coreWdt));
    reg_memcpy (&gDumpReg.coreIntrDis, pRawReg->coreIntrDis, sizeof(gDumpReg.coreIntrDis));
    //reg_memcpy (&gDumpReg.usbOtg, pRawReg->usbOtg, sizeof(gDumpReg.usbOtg));
    //reg_memcpy (&gDumpReg.usbHost, pRawReg->usbHost, sizeof(gDumpReg.usbHost));
    reg_memcpy (&gDumpReg.mac, pRawReg->mac, sizeof(gDumpReg.mac));
    //reg_memcpy (&gDumpReg.gps, pRawReg->gps, sizeof(gDumpReg.gps));
    reg_memcpy (&gDumpReg.hsadc, pRawReg->hsadc, sizeof(gDumpReg.hsadc));
    reg_memcpy (&gDumpReg.sdmmc0, pRawReg->sdmmc0, sizeof(gDumpReg.sdmmc0));
    reg_memcpy (&gDumpReg.sdio, pRawReg->sdio, sizeof(gDumpReg.sdio));
    reg_memcpy (&gDumpReg.eMmc, pRawReg->eMmc, sizeof(gDumpReg.eMmc));
    reg_memcpy (&gDumpReg.pidFilter, pRawReg->pidFilter, sizeof(gDumpReg.pidFilter));
    //reg_memcpy (&gDumpReg.ahbArbiter0, pRawReg->ahbArbiter0, sizeof(gDumpReg.ahbArbiter0));
    //reg_memcpy (&gDumpReg.ahbArbiter1, pRawReg->ahbArbiter1, sizeof(gDumpReg.ahbArbiter1));
    reg_memcpy (&gDumpReg.periAxiBus, pRawReg->periAxiBus, sizeof(gDumpReg.periAxiBus));
    reg_memcpy (&gDumpReg.nandc, pRawReg->nandc, sizeof(gDumpReg.nandc));
    reg_memcpy (&gDumpReg.smcBank0, pRawReg->smcBank0, sizeof(gDumpReg.smcBank0));
    reg_memcpy (&gDumpReg.smcBank1, pRawReg->smcBank1, sizeof(gDumpReg.smcBank1));

    //reg_memcpy (&gDumpReg.cpuDebug, pRawReg->cpuDebug, sizeof(gDumpReg.cpuDebug));
    reg_memcpy (&gDumpReg.apbCru, pRawReg->apbCru, sizeof(gDumpReg.apbCru));
    reg_memcpy (&gDumpReg.apbPmu, pRawReg->apbPmu, sizeof(gDumpReg.apbPmu));
    reg_memcpy (&gDumpReg.apbGrf, pRawReg->apbGrf, sizeof(gDumpReg.apbGrf));
    reg_memcpy (&gDumpReg.apbGpio6, pRawReg->apbGpio6, sizeof(gDumpReg.apbGpio6));
    reg_memcpy (&gDumpReg.apbTimer3, pRawReg->apbTimer3, sizeof(gDumpReg.apbTimer3));
    reg_memcpy (&gDumpReg.eFuse, pRawReg->eFuse, sizeof(gDumpReg.eFuse));
    reg_memcpy (&gDumpReg.tzpc, pRawReg->tzpc, sizeof(gDumpReg.tzpc));
    reg_memcpy (&gDumpReg.dmac1, pRawReg->dmac1, sizeof(gDumpReg.dmac1));
    reg_memcpy (&gDumpReg.dmac1Reg, pRawReg->dmac1Reg, sizeof(gDumpReg.dmac1Reg));
    reg_memcpy (&gDumpReg.ddrPctl, pRawReg->ddrPctl, sizeof(gDumpReg.ddrPctl));
    reg_memcpy (&gDumpReg.i2c0, pRawReg->i2c0, sizeof(gDumpReg.i2c0));
    reg_memcpy (&gDumpReg.i2c1, pRawReg->i2c1, sizeof(gDumpReg.i2c1));
    reg_memcpy (&gDumpReg.pwm0, pRawReg->pwm0, sizeof(gDumpReg.pwm0));
    reg_memcpy (&gDumpReg.gpio0, pRawReg->gpio0, sizeof(gDumpReg.gpio0));
    reg_memcpy (&gDumpReg.timer0, pRawReg->timer0, sizeof(gDumpReg.timer0));
    reg_memcpy (&gDumpReg.timer1, pRawReg->timer1, sizeof(gDumpReg.timer1));
    reg_memcpy (&gDumpReg.gpio1, pRawReg->gpio1, sizeof(gDumpReg.gpio1));
    reg_memcpy (&gDumpReg.gpio2, pRawReg->gpio2, sizeof(gDumpReg.gpio2));
    reg_memcpy (&gDumpReg.ddrPubl, pRawReg->ddrPubl, sizeof(gDumpReg.ddrPubl));
    reg_memcpy (&gDumpReg.wdt, pRawReg->wdt, sizeof(gDumpReg.wdt));
    reg_memcpy (&gDumpReg.pwm2, pRawReg->pwm2, sizeof(gDumpReg.pwm2));
    reg_memcpy (&gDumpReg.pwm3, pRawReg->pwm3, sizeof(gDumpReg.pwm3));
    reg_memcpy (&gDumpReg.i2c2, pRawReg->i2c2, sizeof(gDumpReg.i2c2));
    reg_memcpy (&gDumpReg.i2c3, pRawReg->i2c3, sizeof(gDumpReg.i2c3));
    reg_memcpy (&gDumpReg.i2c4, pRawReg->i2c4, sizeof(gDumpReg.i2c4));
    reg_memcpy (&gDumpReg.tsAdc, pRawReg->tsAdc, sizeof(gDumpReg.tsAdc));
    reg_memcpy (&gDumpReg.spi0, pRawReg->spi0, sizeof(gDumpReg.spi0));
    reg_memcpy (&gDumpReg.spi1, pRawReg->spi1, sizeof(gDumpReg.spi1));
    reg_memcpy (&gDumpReg.dmac2Reg, pRawReg->dmac2Reg, sizeof(gDumpReg.dmac2Reg));
    reg_memcpy (&gDumpReg.smcReg, pRawReg->smcReg, sizeof(gDumpReg.smcReg));
    reg_memcpy (&gDumpReg.gpio3, pRawReg->gpio3, sizeof(gDumpReg.gpio3));
    reg_memcpy (&gDumpReg.gpio4, pRawReg->gpio4, sizeof(gDumpReg.gpio4));
    reg_memcpy (&gDumpReg.gpio5, pRawReg->gpio5, sizeof(gDumpReg.gpio5));
}
